You are here: Custom Study Programming > Reference > Classes > StudyData > StudyData Methods > get

get

The get method returns a floating value for a given index.

 

Syntax

var get(index);

Parameters

index

Numeric index for which to retrieve the value.

Return Value

Returns a floating value if index is valid, otherwise, returns null.

Example

The following example demonstrates the use of get() method.

 

function calculate(beginIndex, endIndex)

{

var studyData = this.getStudyData("customSMA");

if(studyData != null)

{

//get the last value and write it to the Debug Console

 

if(studyData.count() > 0)

{

var value = studyData.get(studyData.count() - 1);

if(value != null)

{

Debug.writeLine("last value is :" + value);

}

}

}

}

 


Copyright © 2006-2009 ActiveTick LLC